Skip to content

Update Library Values to clarify usage #422

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 11, 2025
Merged

Conversation

pinkeshmars
Copy link
Collaborator

Description

Update Library Values to clarify usage

Linear ticket and magic word Fixes DEVR-998

Type of change

  • Typo fix
  • New feature
  • Enhancement to current docs
  • Removed outdated references
  • Update assets

@pinkeshmars pinkeshmars requested a review from PoojaB26 July 11, 2025 06:29
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.


For example, If someone has built a library that uses OpenAI API, they would define a Library Value for the OpenAI API key. As the user of the library, when you import, you must provide your own API key to ensure the library functions properly.
For example, if someone builds a library with a paginated list or a tabbed interface, they can define Library Values for display settings like `Items per page: 10` or `Initial tab index: 0`. This allows the library user to easily customize the UI behavior to fit their project’s needs without modifying the library’s internal logic.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do a better example maybe? for example if user is building a payment gateway library then the amount & currency (and user id etc) can be passed down to the library from the main project so the payment gateway can initiate a payment for that amount.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

:::danger
**Library Values should not be used to store private or sensitive data**, such as secret API keys or credentials. These values are not currently designed to securely store or handle sensitive information.

The use of *public API key* is generally acceptable, because the keys often have limited permissions, rate limits, or are intended for public use. For instance, if someone creates a library that connects to a public weather API, they might define a Library Value for the API key. Users of that library can then input their own API key to make it work.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are various names for it and we should mention them for SEO such as client-side API keys or Supabase like tools calls it publishable keys etc.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also link to our docs for "restrict api keys" where I mention about how to restrict google cloud api keys when using on the client side. maybe you can give an example that even if you use maps key in a library, you must restrict the key permissions and link to docs

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@pinkeshmars
Copy link
Collaborator Author

Hi @PoojaB26 could you please take a look again?

@PoojaB26 PoojaB26 merged commit b2bea40 into main Jul 11, 2025
1 check passed
@PoojaB26 PoojaB26 deleted the fix/library-values-use-case branch July 11, 2025 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants